{extend name='public/bass' /}



{block name="content"}
<div class="ibox-content">
    <form class="form-horizontal m-t" id="commentForm" novalidate="novalidate" method="post" action="/admin/art">

        <div class="form-group">
            <label class="col-sm-3 control-label">栏目：</label>
            <div class="col-sm-8">
                <select class="form-control m-b" name="cates_id">
                    {foreach $data as $item}
                    <option value="{$item.id}">{$item.cate_name}</option>
                    {/foreach}
                </select>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">标题：</label>
            <div class="col-sm-8">
                <input   type="text" class="form-control"  name="title" >
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">描述：</label>
            <div class="col-sm-8">
                <input  type="text" class="form-control" name="desn" >

            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">内容：</label>
            <div class="col-sm-8">
                <textarea id="body" name="body"  ></textarea>
            </div>
        </div>
        <div class="form-group">
            <div class="col-sm-4 col-sm-offset-3">
                <button class="btn btn-primary" type="submit">提交</button>
            </div>
        </div>
    </form>
</div>
{/block}

{block name="js"}
<script src="/static/admin/js/plugins/validate/jquery.validate.min.js"></script>
<script src="/static/admin/js/plugins/validate/messages_zh.min.js"></script>
<script src="/static/admin/js/demo/form-validate-demo.min.js"></script>

<!--ueditor-->
<!-- 配置文件 -->
<script type="text/javascript" src="/static/ueditor/ueditor.config.js"></script>
<!-- 编辑器源码文件 -->
<script type="text/javascript" src="/static/ueditor/ueditor.all.js"></script>


<script>
    //前端js验证
        $('#commentForm').validate({
            rules:{
                title:"required",
                desn:"required",
            },
            messages:{
                title:{
                    required:"标题必须填写"
                },
                desn:{
                    required:"描述必须填写"
                },
            },
            submitHandler:function (form) {
                // alert('确认提交吗?')
                form.submit();
            }

        });
    //实例化编辑器


    var ue = UE.getEditor('body', {
        autoHeight: false
    });



</script>


{/block}

